home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / e / Text_Plug2.lha / text_plug.readme < prev   
Encoding:
Text File  |  1996-02-28  |  2.8 KB  |  75 lines

  1. Short: Flexible Text PLUGIN
  2. Type: dev/e
  3. Author: jason@fsel.com (Jason R. Hulance)
  4.  
  5. text_plug.m defines a new text PLUGIN for use with EasyGUI.  It has
  6. several advantages over a normal TEXT gadget:
  7.  
  8.  1) It only renders within its allocated space, even if you change the
  9.     text.  (If you change the text of a normal TEXT gadget to a long
  10.     string then it will overwrite the window border.)
  11.  2) You can specify the fonts to use for the label and the main string.
  12.  3) In conjunction with the supplied fonts.m module, you can easily
  13.     use the user's preferred default font (fixed width) or screen font
  14.     (usually proportional).
  15.  4) If you resize the GUI, more/less of the string will be shown, as
  16.     possible.
  17.  
  18. An example program is supplied which uses an ASL requester for you to
  19. select a font.  The use's preferred default font and screen font are
  20. also used in the example.
  21.  
  22. Sources are included!
  23.  
  24. Usage
  25. -----
  26. The constructor is:
  27.  
  28.   PROC create(str, label=NIL, min=0, sfont=NIL:PTR TO textfont,
  29.               lfont=NIL:PTR TO textfont)
  30.  
  31.  o 'str'    The main string to be displayed.  The remaining arguments
  32.             are optional.
  33.  o 'label'  A (fixed) label to be displayed before the string.
  34.  o 'min'    The minimum number of characters of the string that will
  35.             be displayed after any resize of the GUI.  If it is zero
  36.             (the default) then this minimum width will be sufficient
  37.             to always display the whole of the initial 'str'.  (The
  38.             label will always get to be displayed.)
  39.  o 'sfont'  The font to be used for the main string.  The default is
  40.             to use the user's preferred default font (which is fixed
  41.             width) via the deffixedfont variable (see below).
  42.  o 'lfont'  The font to be used for the label.  The default is to use
  43.             the user's preferred screen font (which is the default
  44.             font for EasyGUI) via the deffont variable (see below).
  45.  
  46. Once you've created a text_plug and added to your EasyGUI you can
  47. change the string that is being displayed (but you can't change the
  48. label).
  49.  
  50.   PROC settext(gh:PTR TO guihandle, str)
  51.  
  52. This is very similar to the EasyGUI settext() function, and so needs
  53. no further explanation.
  54.  
  55. If you choose to use the default fonts then create() will raise the
  56. exception "DFNT" if one of the required default fonts is not
  57. available.
  58.  
  59. Preferred Fonts
  60. ---------------
  61. The module fonts.m defines two global variables, deffont and
  62. deffixedfont, and two functions to allocate and deallocate these
  63. resources:
  64.  
  65.   PROC getdeffonts()
  66.  
  67.   PROC freedeffonts()
  68.  
  69. If you are going to make use of the default fonts in text_plug then
  70. you need to call getdeffonts() first, and call freedeffonts() after
  71. you've finished using the GUI.  See the example program...
  72.  
  73. getdeffonts() will raise the exceptions "FONT" or "PUBS" if an error
  74. occurs and the fonts could not be allocated.
  75.